package com.ysy.config;


import com.alibaba.nacos.shaded.com.google.common.util.concurrent.RateLimiter;
import com.ysy.mq.FollowAndCancelConsumer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@RefreshScope
public class FollowAndCancelConsumerMqLimitConfig {


    @Value("${mq-consumer.follow-cancel.limit}")
    private double followAndCancelLimit;

    @Bean
    @RefreshScope
    public RateLimiter followAndCancelConsumer() {
        return RateLimiter.create(followAndCancelLimit);
    }


}
